package org.nekperu15739.aboutme.persistencemodel.domain.implementation.i18n;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.nekperu15739.aboutme.persistencemodel.domain.abstracts.EntityAbstract;

@Entity
@Table(name = "user", schema = "i18n")
public class User extends EntityAbstract<User, Short> implements Serializable {

	private static final long serialVersionUID = 1L;

	private Short userId;
	private String userName;
	private Language language;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "userId", length = 3, nullable = false, unique = true)
	public Short getUserId() {
		return userId;
	}

	public void setUserId(Short userId) {
		this.userId = userId;
	}

	@Column(name = "userName", length = 10)
	public String getUserName() {
		return userName;
	}

	public void setUserName(String name) {
		this.userName = name;
	}

	// @Column
	@OneToOne
	public Language getLanguage() {
		return language;
	}

	public void setLanguage(Language language) {
		this.language = language;
	}

	@Override
	@Transient
	public Short getPrimaryKey() {
		return getUserId();
	}

}
